<?php

namespace app\api\model;

use think\Model;

class BaseConfig extends Model
{
    /**
     * 获取系统参数
     * @param $name 参数名称
     * @return mixed|string
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public static function config_data($name){
        $data = self::where('name',$name)->field('data')->find();
        if(!empty($data)){
            return $data['data'];
        }else{
            return '';
        }
    }
}